#include <iostream>

using namespace std;

class Node{
public:
	int data;
	Node *lchild;
	Node *rchild;
};

Node* creatTree() {
	Node *a =NULL;
	return a;
}

Node* treeInsert(Node * &t,int n) {
	if (t==NULL) {
		t = new Node;
		t->data = n;
		t->lchild = NULL;
		t->rchild = NULL;
		cout << "inserted!" << endl;
	} 
	else {
		if (n>t->data) {
			cout << "right ";
			treeInsert(t->rchild,n);
		} 
		else {
			cout << "left ";
			treeInsert(t->lchild,n);
		}
	}
	return t;
}

void preT(Node *t){
	if (t!=NULL) {
		cout << t->data << endl;
		preT(t->lchild);
		preT(t->rchild);
	}
	else {
		cout << "none" <<endl;
	}
}

int main() {
	Node *t = creatTree();
	treeInsert(t,34);
	treeInsert(t,52);
	treeInsert(t,1);
	treeInsert(t,8);
	treeInsert(t,14);
	cout << "following is preT" << endl;
	preT(t);
	return 0;
}